<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="keywords" content="licence,informatique,web,html" />
<meta name="description" content="Site web e-commerce" />
<meta name="author" content="Charles HURTEVENT Quentin LAUJAC" />
<link rel="stylesheet" href="style.css" />
<script type="text/javascript" src="fonctions.js"></script>
<title>Lepino compagny</title>
</head>
<body>
	<div id="bloc_page">
		<header>
			<div id="titre_principal">
				<h1>Lepino compagny</h1>
			</div>
			<p align="right">
			<?php include './affichage_user.php'; ?>
			</p>
			<form align="right" id="bouton"
				action="../action/deconnexionAction.php" method="post">
				<input id="deconnexion" name="deconnexion" type="submit"
					value="Se déconnecter" />
			</form>
		</header>

		<div id="banniere_image">
			<div id="banniere_description">
				<a href="./admin.php" class="bouton_rouge">Retour au menu<img
					src="images/flecheblanchedroite.png" alt="" /> </a>
			</div>
		</div>

		<section>
			<article>
				<TABLE width="100%">
					<CAPTION>
						<b>Liste des commandes facturées</b><br></br>
					</CAPTION>
					<TR>
						<TH>date de commande</TH>
						<TH>numéro de commande</TH>
						<TH>nom du responsable</TH>
						<TH>montant facture</TH>
						<TH>Etat colis</TH>
						<TH>Détails</TH>
					</TR>
					<?php
					require_once ("../bean/data/Commande.php");
					require_once ("../bean/data/Article.php");
					require_once ("../bean/data/Lieu.php");
					require_once ("../bean/data/Facture.php");

					session_start ();

					$id = 0;
					foreach ( $_SESSION ['listCommande'] as $commande ) {
						if ($commande->isValide ()) {
							echo '<form id="facturerCommande'.$id.'" name="form'.$id.'" action="../action/faireColisAction.php" onsubmit="" method="post">';
							echo "<td>" . $commande->getDateCommande () . "</td>";
							echo "<td>" . $commande->getNumeroCommande () . "</td>";
							echo "<td>" . $commande->getClient()->getNom() . "</td>";
							echo "<td>" . $commande->getFacture()->getMontantFacture() . "</td>";
							echo "<td>";
							echo '<input type="hidden" name="numClient" value="' . $commande->getClient()->getNumeroResponsable() . '">';
							echo '<input type="hidden" name="numCommande" value="' . $commande->getNumeroCommande(). '">';
							if($commande->isColisFait()){
								echo '<FONT COLOR="green">Fait</FONT>';
							}else{
								echo '<input type="submit" name="changerEtat" value="Fait"
											onclick="" style="background-color: orange">';
							}
							echo "</td>";
							echo "<td>";
							echo "<input type=\"button\" value=\"Details\"
											onclick=\"window.open('../action/detailsCommandeAction.php?var=".$id."', 'Détails commande', 'height=600, width=920, top=90, left=350, toolbar=no, menubar=no, location=yes, resizable=yes, scrollbars=yes, status=no');\">";
							echo "</td>";
							echo "</tr>";
							$id++;
							echo "</form>";
						}
					}
					?>
				</TABLE>
			</article>
		</section>


	</div>
</body>
</html>
